export type SocketConstructor = {
    url: string,//连接地址
    is_reconnect?: boolean//是否短线重连
    reconnectNum?: number//重连次数
}

/**
 * 链接事件
 */
export type SocketEvent = {
    onopen?: ((this: WebSocket, ev: Event) => any) | null
    onclose?: ((this: WebSocket, ev: CloseEvent) => any) | null
    onerror?: ((this: WebSocket, ev: Event) => any) | null
    onmessage?: ((this: WebSocket, ev: MessageEvent) => any) | null
}